<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1{ width: 500px; height: 500px; background-color: seagreen;}
        .div2{width: 400px;height: 400px; background-color: tan; }
        .div3{width: 300px;height: 300px; background-color: skyblue; }
    </style>
</head>
<body>
    <div class="div1">
        <div class="div2">
            <div class="div3"></div>
        </div>
    </div>
    <script>
        document.querySelector('.div1').addEventListener('click',function(){
            console.log('div1 click')
        })
        document.querySelector('.div2').addEventListener('click',function(){
            console.log('div2 click')
        })
        document.querySelector('.div3').addEventListener('click',function(event){
            // 阻止事件冒泡哦，也就是终止事件传播，一旦在这里终止 后续就不会上升
            event.stopPropagation();
            console.log('div3 click')
        })
    </script>
</body>
</html>